#!/bin/bash
mkdir ~/.socialwhale
mkdir ~/.socialwhale/plugins
mkdir ~/.socialwhale/themes

homedir="$(echo ~)"

function build_whale_project {
    mkdir build
    cd build
    cmake ../ -DCMAKE_INSTALL_PREFIX=/usr -DHOME_DIRECTORY=$homedir
    make
    echo "Type your sudo password if prompted"
    sudo make install
    cd ../
}

# build main application
build_whale_project

# build standard plugins
cd plugins
PLUGINS="*"
for p in $PLUGINS; do
    cd "$p"
    build_whale_project
    cd ../
done
